package com.ruoyi.system.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysProjectBidevaluationProcess;
import com.ruoyi.system.service.ISysProjectBidevaluationProcessService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 项目流程Controller
 * 
 * @author ruoyi
 * @date 2024-08-03
 */
@RestController
@RequestMapping("/system/projectbidevaluationprocess")
public class SysProjectBidevaluationProcessController extends BaseController
{
    @Autowired
    private ISysProjectBidevaluationProcessService sysProjectBidevaluationProcessService;

    /**
     * 查询项目流程列表
     */
    @PreAuthorize("@ss.hasPermi('system:projectbidevaluationprocess:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysProjectBidevaluationProcess sysProjectBidevaluationProcess)
    {
        startPage();
        List<SysProjectBidevaluationProcess> list = sysProjectBidevaluationProcessService.selectSysProjectBidevaluationProcessList(sysProjectBidevaluationProcess);
        return getDataTable(list);
    }

    /**
     * 查询项目流程列表
     */
    @PreAuthorize("@ss.hasPermi('system:projectbidevaluationprocess:lists')")
    @GetMapping("/lists")
    public AjaxResult lists(SysProjectBidevaluationProcess sysProjectBidevaluationProcess)
    {
        List<SysProjectBidevaluationProcess> list = sysProjectBidevaluationProcessService.selectSysProjectBidevaluationProcessList(sysProjectBidevaluationProcess);
        return success(list);
    }

    /**
     * 导出项目流程列表
     */
    @PreAuthorize("@ss.hasPermi('system:projectbidevaluationprocess:export')")
    @Log(title = "项目流程", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysProjectBidevaluationProcess sysProjectBidevaluationProcess)
    {
        List<SysProjectBidevaluationProcess> list = sysProjectBidevaluationProcessService.selectSysProjectBidevaluationProcessList(sysProjectBidevaluationProcess);
        ExcelUtil<SysProjectBidevaluationProcess> util = new ExcelUtil<SysProjectBidevaluationProcess>(SysProjectBidevaluationProcess.class);
        util.exportExcel(response, list, "项目流程数据");
    }

    /**
     * 获取项目流程详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:projectbidevaluationprocess:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(sysProjectBidevaluationProcessService.selectSysProjectBidevaluationProcessById(id));
    }

    /**
     * 新增项目流程
     */
    @PreAuthorize("@ss.hasPermi('system:projectbidevaluationprocess:add')")
    @Log(title = "项目流程", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysProjectBidevaluationProcess sysProjectBidevaluationProcess)
    {
        return toAjax(sysProjectBidevaluationProcessService.insertSysProjectBidevaluationProcess(sysProjectBidevaluationProcess));
    }

    /**
     * 修改项目流程
     */
    @PreAuthorize("@ss.hasPermi('system:projectbidevaluationprocess:edit')")
    @Log(title = "项目流程", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysProjectBidevaluationProcess sysProjectBidevaluationProcess)
    {
        return toAjax(sysProjectBidevaluationProcessService.updateSysProjectBidevaluationProcess(sysProjectBidevaluationProcess));
    }

    /**
     * 删除项目流程
     */
    @PreAuthorize("@ss.hasPermi('system:projectbidevaluationprocess:remove')")
    @Log(title = "项目流程", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(sysProjectBidevaluationProcessService.deleteSysProjectBidevaluationProcessByIds(ids));
    }
}
